//
//  SEGOrderInputModel.m
//  Uhomebk
//
//  Created by mac on 2017/10/13.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "SEGOrderInputModel.h"

@implementation SEGOrderInputModel
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}
- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    
    self = [super init];
    if (self) {
        _templateInstId = @"";
        _templateDifId = @"";
        _aliasName = @"";
        _aliasIcon= @"";
        _templateId = @"";
        _templateName = @"";
        _isBespeak = @"";
        _categoryId = @"";
        _childrenList = [[NSArray alloc] init];
        [self setValuesForKeysWithDictionary:dictionary];
        self.mDictionary = [[NSMutableDictionary alloc] initWithDictionary:dictionary];
    }
    return self;
}
-(void)setAliasName:(NSString *)aliasName{
      _aliasName = [SEGUtils ValueToString:aliasName];
}

-(void)setTemplateDifId:(NSString *)templateDifId{
    _templateDifId = [SEGUtils ValueToString:templateDifId];
}

-(void)setAliasIcon:(NSString *)aliasIcon{
    _aliasIcon = [SEGUtils ValueToString:aliasIcon];
}

-(void)setTemplateId:(NSString *)templateId{
    _templateId = [SEGUtils ValueToString:templateId];
}

-(void)setTemplateName:(NSString *)templateName{
    _templateName = [SEGUtils ValueToString:templateName];
}

-(void)setTemplateInstId:(NSString *)templateInstId{
    _templateInstId = [SEGUtils ValueToString:templateInstId];
}

-(void)setIsBespeak:(NSString *)isBespeak{
    _isBespeak = [SEGUtils ValueToString:isBespeak];
}

-(void)setCategoryId:(NSString *)categoryId{
    _categoryId = [SEGUtils ValueToString:categoryId];
}

- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{
}


- (void)setValue:(id)value forKey:(NSString*)key
{
    if ([key isEqualToString:@"busiType"]) {
        NSMutableArray* _arrM = [NSMutableArray array];
        for (NSDictionary* dict in value) {
            SEGOrderInputChildModel* model = [SEGOrderInputChildModel initWithDictionary:dict];
            [_arrM addObject:model];
        }
        _childrenList = _arrM;
        return;
    }
    [super setValue:value forKey:key];
}

@end
